import Vue from 'vue'
import Router from 'vue-router'
import AdminLayout from '@/pages/admin/layout'

Vue.use(Router)

export default new Router({
  routes: [{
    path: '/admin/login',
    name: 'admin-login',
    component: (resolve) => require(['@/pages/admin/login'], resolve),
    meta: {
      title: "管理员登录"
    }
  }, {
    path: '/admin',
    component: AdminLayout,
    children: [{
        path: '/admin/index',
        name: 'amdin-index',
        component: (resolve) => require(['@/pages/admin/index'], resolve),
        meta: {
          title: "首页"
        }
      },
      {
        path: '/admin/sale/clientlist',
        name: 'admin-sale-clientlist',
        component: (resolve) => require(['@/pages/admin/sale/client/list'], resolve),
        meta: {
          title: "客户管理"
        }
      },
      {
        path: '/admin/sale/orderlist',
        name: 'admin-sale-orderlist',
        component: (resolve) => require(['@/pages/admin/sale/order/index'], resolve),
        meta: {
          title: "内容管理"
        }
      },
      {
        path: '/admin/product/list',
        name: 'admin-product-list',
        component: (resolve) => require(['@/pages/admin/product/index'], resolve),
        meta: {
          title: "产品列表"
        }
      }
    ]
  }]
})
